﻿using Microsoft.AspNetCore.Http;

namespace PMS.Core.Utils.Authentication
{
    /// <summary>
    /// Represents default values related to authentication services
    /// </summary>
    public static partial class AuthenticationDefaultConfigs
    {
        /// <summary>
        /// The default value used for authentication scheme
        /// </summary>
        public static string DefaultAuthenticationScheme => "Authentication";

        /// <summary>
        /// Cookie Based Authentication Expiration Minutes
        /// </summary>
        public static int CookieExpirationMinutes => 90;
        /// <summary>
        /// The default value used for external authentication scheme
        /// </summary>
        public static string ExternalAuthenticationScheme => "ExternalAuthentication";

        /// <summary>
        /// Jwt Auth scheme
        /// </summary>
        public static string JwtAuthenticationScheme => "PMS.JwtAuthentication";
        /// <summary>
        /// The issuer that should be used for any claims that are created
        /// </summary>
        public static string ClaimsIssuer => "PMS.DefaultIssuer";

        /// <summary>
        /// The default value for the login path
        /// </summary>
        public static PathString LoginPath => new PathString("/login");

        /// <summary>
        /// The default value used for the logout path
        /// </summary>
        public static PathString LogoutPath => new PathString("/logout");

        /// <summary>
        /// PageNotFoundPath
        /// 与AccessDeniedPath区分开
        /// </summary>
        public static PathString PageNotFoundPath => new PathString("/error/pagenotfound");
        /// <summary>
        /// The default value for the access denied path
        /// </summary>
        public static PathString AccessDeniedPath => new PathString("/error/accessdenied");

        public static PathString ErrorPath => new PathString("/error/error");
        /// <summary>
        /// The default value of the return URL parameter
        /// </summary>
        public static string ReturnUrlParameter => string.Empty;

        /// <summary>
        /// Gets a key to store external authentication errors to session
        /// </summary>
        public static string ExternalAuthenticationErrorsSessionKey => "pms.externalauth.errors";

        /// <summary>
        /// Default Expire Minutes for Jwt Auth Expiration time
        /// </summary>
        public static int JwtExpirationMinutes => 120;
        /// <summary>
        /// SECRET USED TO SIGN AND VERIFY JWT TOKENS, IT CAN BE ANY STRING
        /// </summary>
        public static string JwtIssuerSigningKey => "PMS_Author_David_1234qwerasdfzxcv";
        public static string JwtValidAudience => "PMS.jwt.ValidAudience";
        public static string JwtValidIssuer => "PMS.jwt.ValidIssuer";

        public static string ItemIdHashSalt => "DavidLee198412";
    }

}
